/**
 * 
 */
package cz.cuni.mff.abacs.burglar.logics.objects.positions;

import cz.cuni.mff.abacs.burglar.logics.DataMap;
import cz.cuni.mff.abacs.burglar.logics.objects.BaseInterface;
import cz.cuni.mff.abacs.burglar.logics.objects.Room;


/**
 * Interface of the position objects.
 * 
 * @author abacs
 *
 */
public interface Position extends BaseInterface {
	
	
	/**
	 * Returns the global x coordinate of the position.
	 * 
	 * @return x coordinate of the position.
	 */
	public int getX();
	
	
	/**
	 * Returns the global y coordinate of the position.
	 * 
	 * @return y coordinate of the position.
	 */
	public int getY();
	
	
	/**
	 * Connects together neighboring positions.
	 */
	public void connect(BasePosition pos);
	
	
	/**
	 * Disconnects positions so they are no longer reachable from each other.
	 */
	public void disconnect();
	
	
	/**
	 * Whether two positions re next to each other (they don't have to be reachable).
	 */
	public boolean isNeighbouring(BasePosition other);
	
	
	/**
	 * Returns the room where the position is situated.
	 * 
	 * @return Room object of the position.
	 */
	public Room getRoom();
	
	
	/**
	 * Returns the room where the position is situated.
	 * 
	 * @return Identifier of the Room of the position.
	 */
	public int getRoomId();
	
	
	/**
	 * Returns whether the position is in the selected room.
	 * 
	 * @return true if the position is in the selected room;
	 *         false if the position is not in the selected room.
	 */
	public boolean isInRoom(Room room);
	
	
	/**
	 * Returns whether the position is in the selected room.
	 * 
	 * @return true if the position is in the selected room;
	 *         false if the position is not in the selected room.
	 */
	public boolean isInRoom(int roomId);
	
	
	/** 
	 * Returns whether it is more interesting than a setting stone.
	 * (an agent or the player can interact with it.)
	 * 
	 * @return 
	 */
	public boolean isOperable();
	
	
	/**
	 * Returns whether it is dangerous for the burglar to be in the same room with it.
	 * 
	 * @return
	 */
	public boolean isTrap();
	
	
	// -------------------------------------------------------------------------
	
	
	/**
	 * Returns a copy of the position as observable from a far distance.
	 * 
	 * @return copy of the position with possible distortions.
	 */
	public Position examinedFromFar();
	
	
	/**
	 * Returns a copy of the position as observable from close examination.
	 * 
	 * @return copy of the position without distortions.
	 */
	public Position examinedFromNear();
	
	
	/**
	 * Returns whether the object matches another one in a close examination.
	 * 
	 * @return whether the object matches another one in a close examination.
	 */
	public boolean matchesFromClose(Position position);
	
	
	/**
	 * Returns whether the object matches another one from a distance.
	 * 
	 * @return whether the object matches another one from a distance.
	 */
	public boolean matchesFromFar(Position position);
	
	
	/**
	 * Special copy that copies only the changeable properties of a position.
	 * 
	 * Intended to be used to synchronize objects representing the same game objects, 
	 * only in different states.
	 * @param original 
	 */
	public void copyChangeables(Position original);
	
	
	/**
	 * Copies the position in reference to a new reference map.
	 * 
	 * @param reference map intended to contain the new position object.
	 */
	public Position copy(DataMap reference);
	
}
